package com.cnswhy.cloud.server.core.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.cnswhy.cloud.common.core.base.entity.Entity;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;
import java.time.LocalDateTime;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import static com.cnswhy.cloud.common.core.utils.DateUtils.DEFAULT_DATE_TIME_FORMAT;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 
 * </p>
 *
 * @author cnswhy
 * @since 2021-03-06
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("t_iot_charging_line_info")
@ApiModel(value = "IotChargingLineInfo", description = "")
@AllArgsConstructor
public class IotChargingLineInfo extends Entity<Long> {

    private static final long serialVersionUID = 1L;

    /**
     * 终端编号
     */
    @ApiModelProperty(value = "终端编号")
    @Length(max = 20, message = "终端编号长度不能超过20")
    @TableField(value = "terminal_id", condition = LIKE)
    @Excel(name = "终端编号")
    private String terminalId;

    /**
     * 状态
     */
    @ApiModelProperty(value = "状态")
    @TableField("type")
    @Excel(name = "状态")
    private Integer type;

    /**
     * 0失效 1 生效
     */
    @ApiModelProperty(value = "0失效 1 生效")
    @TableField("status")
    @Excel(name = "0失效 1 生效")
    private Integer status;

    /**
     * 组A序列号
     */
    @ApiModelProperty(value = "组A序列号")
    @TableField("a_index")
    @Excel(name = "组A序列号")
    private Integer aIndex;

    /**
     * 组B序列号
     */
    @ApiModelProperty(value = "组B序列号")
    @TableField("b_index")
    @Excel(name = "组B序列号")
    private Integer bIndex;

    /**
     * 组C序列号
     */
    @ApiModelProperty(value = "组C序列号")
    @TableField("c_index")
    @Excel(name = "组C序列号")
    private Integer cIndex;

    /**
     * 开始时间
     */
    @ApiModelProperty(value = "开始时间")
    @TableField("start_time")
    @Excel(name = "开始时间", format = DEFAULT_DATE_TIME_FORMAT, width = 20)
    private LocalDateTime startTime;

    /**
     * 结束时间
     */
    @ApiModelProperty(value = "结束时间")
    @TableField("end_time")
    @Excel(name = "结束时间", format = DEFAULT_DATE_TIME_FORMAT, width = 20)
    private LocalDateTime endTime;


    @Builder
    public IotChargingLineInfo(Long id, LocalDateTime createTime, LocalDateTime updateTime, Long updateUser, Long createUser, 
                    String terminalId, Integer type, Integer status, Integer aIndex, Integer bIndex, 
                    Integer cIndex, LocalDateTime startTime, LocalDateTime endTime) {
        this.id = id;
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.updateUser = updateUser;
        this.createUser = createUser;
        this.terminalId = terminalId;
        this.type = type;
        this.status = status;
        this.aIndex = aIndex;
        this.bIndex = bIndex;
        this.cIndex = cIndex;
        this.startTime = startTime;
        this.endTime = endTime;
    }

}
